package com.gang.mars.basic.resolvabletype;

import java.lang.reflect.Type;

/**
 * @author gang.chen
 * @description
 * @Date 2021/8/13 8:59
 */
public class Pear01 {

    private Class<?> resolved;
    private final Type type;
    private final Integer hash;
    private final Pear01 componentType;
    private final Pear02 typeProvider;
    private final Pear03 variableResolve;

    private static final Pear01[] EMPTY_TYPES_ARRAY = new Pear01[0];

    private Pear01(Class<?> clazz){
        this.hash = null;
        this.resolved = clazz;
        this.type = this.resolved;
        this.componentType = null;
        this.typeProvider = null;
        this.variableResolve = null;
    }

    public static void main(String[] args) {

        Pear01 pear01 = Pear01.forRawClass(String.class);
        System.out.println(pear01);
    }

    public static Pear01 forRawClass(Class<?> clazz){
        return new Pear01(clazz){
            @Override
            public Pear01[] getGenerics() {
                return EMPTY_TYPES_ARRAY;
            }
        };
    }

    public Pear01[] getGenerics(){
        System.out.println("1->getGenerics()");
        return null;
    }
}
